package com.wandian.controller
{
	import com.wandian.data.GameData;
	import com.wandian.view.mediator.ChatRoomMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**   
	 * 聊天室命令
	 * @author long
	 * @Create  2012-10-6 下午05:03:21   
	 * @QQ 108232706
	 * @version 1.0   
	 */   
	public class ChatRoomCommand extends SimpleCommand
	{
		public function ChatRoomCommand()
		{
			super();
		}	
		public override function execute(notification:INotification):void
		{
			var texas:Texas=notification.getBody() as Texas;
			switch (notification.getName())
			{
				case CLZNoticeName.CHATROOMCOMMAND_ENTER_CHATROOM:
				{
					var UIChatRoom:MovieClip=GameData.getMovieClip("ChatPanel");// BitmapManager.instance.getMCByName("UILogin");
					Texas.I._mcTableView.addChild(UIChatRoom);
					Texas.I._mcTableView.centerXY(UIChatRoom);//居中显示
					this.facade.registerMediator(new ChatRoomMediator(UIChatRoom));
					break;
				}
					
				default:
				{
					break;
				}
			}
			
		}
	}
}